<?php

/**
 * Preinscripto filter form base class.
 *
 * @package    sistema_itec_new
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasePreinscriptoFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'apellido'                 => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'nombre'                   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'telefono'                 => new sfWidgetFormFilterInput(),
      'celular'                  => new sfWidgetFormFilterInput(),
      'email'                    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'documento'                => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'localidad_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Localidad'), 'add_empty' => true)),
      'unidad_formacion_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('UnidadFormacion'), 'add_empty' => true)),
      'accion_comunicacional_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('AccionComunicacional'), 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'apellido'                 => new sfValidatorPass(array('required' => false)),
      'nombre'                   => new sfValidatorPass(array('required' => false)),
      'telefono'                 => new sfValidatorPass(array('required' => false)),
      'celular'                  => new sfValidatorPass(array('required' => false)),
      'email'                    => new sfValidatorPass(array('required' => false)),
      'documento'                => new sfValidatorPass(array('required' => false)),
      'localidad_id'             => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Localidad'), 'column' => 'id')),
      'unidad_formacion_id'      => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('UnidadFormacion'), 'column' => 'id')),
      'accion_comunicacional_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('AccionComunicacional'), 'column' => 'id')),
    ));

    $this->widgetSchema->setNameFormat('preinscripto_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Preinscripto';
  }

  public function getFields()
  {
    return array(
      'id'                       => 'Number',
      'apellido'                 => 'Text',
      'nombre'                   => 'Text',
      'telefono'                 => 'Text',
      'celular'                  => 'Text',
      'email'                    => 'Text',
      'documento'                => 'Text',
      'localidad_id'             => 'ForeignKey',
      'unidad_formacion_id'      => 'ForeignKey',
      'accion_comunicacional_id' => 'ForeignKey',
    );
  }
}
